package top.eggcode.system.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import top.eggcode.common.mvc.Result;
import top.eggcode.system.client.factory.LogClientFactory;
import top.eggcode.system.client.model.*;

@FeignClient(name = "sense-system", contextId = "logClientService", fallback = LogClientFactory.class)
public interface LogClientService {

    @PostMapping(value = "/api/log/action/save", headers = "source=inner")
    Result<Boolean> saveToAction(@RequestBody ActionLog log);

    @PostMapping(value = "/api/log/exception/save", headers = "source=inner")
    Result<Boolean> saveToException(@RequestBody ExceptionLog log);

    @PostMapping(value = "/api/api/log/function/save", headers = "source=inner")
    Result<Boolean> saveToFunction(@RequestBody FuncLog log);

    @PostMapping(value = "/api/log/login/save", headers = "source=inner")
    Result<Boolean> saveToLogin(@RequestBody LoginLog log);

    @PostMapping(value = "/api/log/storage/save", headers = "source=inner")
    Result<Boolean> saveToStorage(@RequestBody StorageLog log);

    @PostMapping(value = "/api/log/visit/save", headers = "source=inner")
    Result<Boolean> saveToVisit(@RequestBody VisitLog log);
}
